package baseclass.e_tree;


import utils.TreeNode;

/**
 * @date 2020/2/29 14:26
 */
public class Code05_TreeHeight {
    public static int getHeight(TreeNode treeNode){
        if(treeNode == null) return 0;
        int left = getHeight(treeNode.left);
        int right = getHeight(treeNode.right);
        return Math.max(left,right) + 1;
    }
}
